package com.ruoyi.loan.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.loan.dto.SelectLoadDto;
import com.ruoyi.loan.entity.LoanRecord;
import com.ruoyi.loan.entity.User;
import com.ruoyi.loan.vo.LoanRecordDetailVo;
import com.ruoyi.loan.vo.LoanRecordVo;
import com.ruoyi.loan.vo.SelectLoanVo;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * Author: 廖振辉
 * Date: 2022/4/5
 * Description:
 */
public interface LoanRecordMapper extends BaseMapper<LoanRecord> {


    /**
     * 获取贷款列表
     *
     * @param dto 参数信息
     * @return
     */
    List<SelectLoanVo> selectLoanList(SelectLoadDto dto);

    /**
     * 根据用户id查询 用户的贷款记录
     *
     * @param id
     * @return
     */
    List<LoanRecordVo> getMyLoanRecord(Integer id);

    /**
     * 根据贷款id，查询贷款详情信息
     *
     * @param id
     * @return
     */
    LoanRecordDetailVo getLoanRecordDetailsById(int id);

    /**
     * 查询待审核的贷款信息
     *
     * @param dto
     * @return
     */
    List<SelectLoanVo> getVerityLoanList(SelectLoadDto dto);

    /**
     * 查询待还款的订单
     *
     * @param loanId
     * @return
     */
    LoanRecordDetailVo getPaymentMessage(Integer loanId);

    LoanRecord selectByUserIdAndYear(@Param("userId") Integer userId, @Param("year") Integer year);
}
